<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<title>UserEmailFinder - Find email addresses of students and faculty members</title>
</head>
<body>
<center>
<% form_tag({:controller => "basics", :action => 'user_email_finder_results'}, :method => "post") do %>
	<%= label_tag(:q, "Name: ") %>
	<%= text_field_tag :q, nil, :size => 35 %>
	<%= submit_tag("Find") %>
<% end %>
<br/>
<div>
	<table>
	<TR><td colspan=3><h3>Search Results For : <%= @fw %></h3></td></TR>
	<TR><td colspan=3><h4>Students</h4></td></TR>
	<%
	if @student_exists	
	   @students.each do |student|
	%>
	<TR><TD><%= student[0] %></TD><TD><%= student[1] %></TD><TD style="padding-left: 12px"><%= student[2] %></TD></TR>
	<%
	   end
	else  
	%>
	<TR><TD colspan=3>No Student with the given name exists</TD><TR/>	
	<%
	end
	%>

	<TR><td colspan=3>&nbsp;</td></TR>
	<TR><td colspan=3><h4>Staff</h4></td></TR>
	<%
	if @staff_exists	
	   @staff.each do |staff|
	%>
	<TR><TD><%= staff[0] %></TD><TD><%= staff[1] %></TD><TD style='padding-left: 12px'><%= staff[2] %></TD></TR>
	<%
	   end
	else %>
	<TR><TD colspan=3>No Staff Exists with the given name exists</TD><TR/>	
	<%
	end
	%>
	</table>
</div>
<!-- FOOTER -->
<%= render :file => 'layouts/footer' %>
<!-- FOOTER END -->
</center>
</body>
</html>
